package com.zxkj.domain.entity;

import javax.persistence.Column;
import javax.persistence.Embeddable;
import java.io.Serializable;

@Embeddable
public class SciMapDeptDocPK implements Serializable {
    public SciMapDeptDocPK() {
    }

    public SciMapDeptDocPK(Integer deptId, String docId) {
        this.deptId = deptId;
        this.docId = docId;
    }

    private static final long serialVersionUID = -2432145316543676L;
    @Column(nullable = false)
    private String docId;
    @Column(nullable = false)
    private Integer deptId;

    public String getDocId() {
        return docId;
    }

    public void setDocId(String docId) {
        this.docId = docId;
    }

    public Integer getDeptId() {
        return deptId;
    }

    public void setDeptId(Integer deptId) {
        this.deptId = deptId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SciMapDeptDocPK that = (SciMapDeptDocPK) o;

        if (!docId.equals(that.docId)) return false;
        return deptId.equals(that.deptId);
    }

    @Override
    public int hashCode() {
        int result = docId.hashCode();
        result = 31 * result + deptId.hashCode();
        return result;
    }

    @Override
    public String toString() {
        return "SciMapDeptDocPK{" +
                "docId='" + docId + '\'' +
                ", deptId=" + deptId +
                '}';
    }
}
